package com.leetcode.bit;

/**
 * @author Dennis Li
 * @date 2020/7/21 14:51
 */
public class MissingNumber_268 {

    public int missingNumber(int[] nums) {
        int res = 0;
        for (int i = 0; i < nums.length; i++)
            res ^= i ^ nums[i];
        return res ^ nums.length;
    }

}
